package com.neusoft.neuiotms.dcam.fixed.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractAuditModel;

import lombok.Getter;
import lombok.Setter;

/**
 * 资产
 *
 * @author sunchf
 */
@Getter
@Setter
@Entity
@Table(name = "neuiot_fixed_asset_attachment")
@org.hibernate.annotations.Table(appliesTo = "neuiot_fixed_asset_attachment", comment = "固定资产附件表")
public class AssetAttachment extends AbstractAuditModel {

    private static final long serialVersionUID = 1L;

    @Length(max = 1023, message = "说明不能超过{max}位")
    @Column(length = 1023)
    private String description;

    /**
     * 附件存储，用||分割多个文件；用@@分割fsId和文件name <br />
     * 16109709907255005.png@@报警通知.png||16109709907255001.png@@报警通知2.png
     */
    @Column(length = 1023, nullable = true)
    private String attachment;

    /**
     * 所属资产
     */
    @OneToOne
    private Asset asset;

}
